package com.tianjian.dao;

import com.io.dao.BaseDaoI;
import com.tianjian.entity.IkExtWordEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface IkExtWordDaoI extends BaseDaoI<IkExtWordEntity, Long>, PagingAndSortingRepository<IkExtWordEntity, Long> {
    /**
     * 查询分词记录
     *
     * @param word
     * @return
     */
    IkExtWordEntity findFirstByWord(String word);

    /**
     * 条件查询
     *
     * @param spec
     * @param pageable
     * @return
     */
    Page<IkExtWordEntity> findAll(Specification<IkExtWordEntity> spec, Pageable pageable);

    /**
     * @param spec
     * @param pageable
     * @return
     */
    Page<IkExtWordEntity> findAllByWordLike(Pageable pageable, String word);
}
